/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.cggveritas.crewintranet.jms.entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import org.codehaus.jackson.annotate.JsonIgnore;

/**
 *
 * @author Alassane
 */
@Entity
@Table(name = "cv_typevisitemedicale")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CvTypevisitemedicale.findAll", query = "SELECT c FROM CvTypevisitemedicale c"),
    @NamedQuery(name = "CvTypevisitemedicale.findByIdtypevisitemedicale", query = "SELECT c FROM CvTypevisitemedicale c WHERE c.idtypevisitemedicale = :idtypevisitemedicale"),
    @NamedQuery(name = "CvTypevisitemedicale.findByTypevisitemedicale", query = "SELECT c FROM CvTypevisitemedicale c WHERE c.typevisitemedicale = :typevisitemedicale")})
public class CvTypevisitemedicale implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idtypevisitemedicale")
    private String idtypevisitemedicale;
    @Basic(optional = false)
    @Column(name = "typevisitemedicale")
    private String typevisitemedicale;
    @Lob
    @Column(name = "commentaire")
    private String commentaire;
    @OneToMany(mappedBy = "idtypevisitemedicale", fetch = FetchType.LAZY)
    private List<CvVistemedical> cvVistemedicalList;

    public CvTypevisitemedicale() {
    }

    public CvTypevisitemedicale(String idtypevisitemedicale) {
        this.idtypevisitemedicale = idtypevisitemedicale;
    }

    public CvTypevisitemedicale(String idtypevisitemedicale, String typevisitemedicale) {
        this.idtypevisitemedicale = idtypevisitemedicale;
        this.typevisitemedicale = typevisitemedicale;
    }

    public String getIdtypevisitemedicale() {
        return idtypevisitemedicale;
    }

    public void setIdtypevisitemedicale(String idtypevisitemedicale) {
        this.idtypevisitemedicale = idtypevisitemedicale;
    }

    public String getTypevisitemedicale() {
        return typevisitemedicale;
    }

    public void setTypevisitemedicale(String typevisitemedicale) {
        this.typevisitemedicale = typevisitemedicale;
    }

    public String getCommentaire() {
        return commentaire;
    }

    public void setCommentaire(String commentaire) {
        this.commentaire = commentaire;
    }

    @XmlTransient
    @JsonIgnore
    public List<CvVistemedical> getCvVistemedicalList() {
        return cvVistemedicalList;
    }

    public void setCvVistemedicalList(List<CvVistemedical> cvVistemedicalList) {
        this.cvVistemedicalList = cvVistemedicalList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idtypevisitemedicale != null ? idtypevisitemedicale.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CvTypevisitemedicale)) {
            return false;
        }
        CvTypevisitemedicale other = (CvTypevisitemedicale) object;
        if ((this.idtypevisitemedicale == null && other.idtypevisitemedicale != null) || (this.idtypevisitemedicale != null && !this.idtypevisitemedicale.equals(other.idtypevisitemedicale))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "fr.cggveritas.crewintranet.jms.entities.CvTypevisitemedicale[ idtypevisitemedicale=" + idtypevisitemedicale + " ]";
    }
    
}
